<template>
  <div class="container">
    <!-- s数据大屏展内容区域 -->
   <div class="screen" ref="screen">
    <div class="top">
      <TOP></TOP>
    </div>
    <div class="buttom">
        <div class="left">
          <Tourist class="tourist"/>
          <Sex class="sex"/>
          <Age class="age"/>
        </div>
        <div class="center">中间</div>
        <div class="right">右侧</div>
      </div>
   </div>
    
  </div>
</template>

<script setup lang="ts">
// 引入子组件
import TOP from "./commponents/top/index.vue"
// 引入左侧三个子组件
import Tourist from "./commponents/tourist/index.vue"
import Sex from "./commponents/sex/index.vue"
import Age from "./commponents/age/index.vue"
import {ref,onMounted} from "vue";
// 获取数据大屏展示内容盒子的DOM元素
let screen = ref();
onMounted(() => {
    screen.value.style.transform = `scale(${getScale()}) translate(-50%,-50%)`
});
//定义大屏缩放比例
function getScale(w = 1920, h = 1080) {
    const ww = window.innerWidth / w;
    const wh = window.innerHeight / h;
    return ww < wh ? ww : wh;
}
</script>

<style lang="scss" scoped>
.container{
  width:100vw;
  height:100vw;
  background:url(./images/bg.png) no-repeat;
  background-size: cover;
  .screen{
    position: fixed;
    width: 1920px;
    height: 1080px;
    // background:yellowgreen;
    left: 50%;
    top: 50%;
    transform-origin: left top;
    .top{
    width:100%;
    height:40px;
    // background: skyblue;
      }
      .buttom{
        display: flex;
        .right{
          flex: 1;
        }
        .left{
          flex:1;
          height:1040px;
          display: flex;
          flex-direction: column;
          .tourist{
            flex:1.5;
          
          }
          .sex{
            flex:1; 
          }
          .age{
            flex: 1;
          }
        }
        .center{
          flex:2;
        }
      }
  }
}
</style>
